package controller;

import java.util.ArrayList;
import java.util.List;
import util.HibernateUtil;
import model.BounBookUser;
import model.UserType;

import com.opensymphony.xwork2.ActionSupport;

public class UserManagementAdminSiteController extends ActionSupport {

	private static final long serialVersionUID = 1L;

	public BounBookUser bounBookUser  = new BounBookUser();
	public UserType userType  = new UserType();
	public List<Object> list = new ArrayList<Object>(); 
	public int id;
	public String password;
	
	public String resetPassword()
	{
		BounBookUser user = HibernateUtil.get(BounBookUser.class, id);
		user.setPassword(password);
		HibernateUtil.update(user);
		list = HibernateUtil.list("from BounBookUser");
		return SUCCESS;
	}
	
	public String delete()
	{
		HibernateUtil.delete(BounBookUser.class, id);
		list = HibernateUtil.list("from BounBookUser");
		return SUCCESS;
	}
	
	public String execute() {
		
		list = HibernateUtil.list("from BounBookUser");
		return SUCCESS;
	}
	
	
}
